/* util */
import http from '@src/util/http'
const headUrl = '/api/customer'

/**
 * @description 统计兑换规则类型数据
 * @param {Object} params -- 参数对象
 */
export function getExchangeType(params: Record<string, never> | undefined) {
  return http.get(`${headUrl}/outside/exchange/rule/getExchangeTypeData`, params);
}

/**
 * @description 分页查询兑换规则列表
 * @param {Object} params -- 参数对象
 */
export function getExchangeRuleList(params: object) {
  return http.post(`${headUrl}/outside/exchange/rule/queryByPage`, params);
}

/**
 * @description 新增兑换规则
 * @param {Object} params -- 参数对象
 */
export function addExchangeRule(params: object) {
  return http.post(`${headUrl}/outside/exchange/rule/insertList`, params);
}

/**
 * @description 修改兑换规则
 * @param {Object} params -- 参数对象
 */
export function updateExchangeRule(params: object) {
  return http.post(`${headUrl}/outside/exchange/rule/update`, params);
}

/**
 * @description 删除兑换规则
 * @param {Object} params -- 参数对象
 */
export function deleteExchangeRule(params: object) {
  return http.post(`${headUrl}/outside/exchange/rule/logicDeleteById`, params);
}

/**
 * @description 获取积分和服务费开关
 * @param {Object} params -- 参数对象
 */
export function getPointsAndServiceFeeEnable(params: Record<string, never> | undefined) {
  return http.get(`${headUrl}/outside/pc/memberConfig/getPointsAndServiceFeeEnable`, params);
}

/**
 * @description 分页查询会员使用记录列表
 * @param {Object} params -- 参数对象
 */
export function getMemberUseRecordPage(params: object) {
  return http.post(`${headUrl}/outside/membership/getMemberUseRecordPage`, params);
}

/**
 * @description 统计业务类型数据
 * @param {Object} params -- 参数对象
 */
export function getModuleData(params: Record<string, never> | undefined) {
  return http.get(`${headUrl}/outside/membership/getMemberConsumeRecordModuleData`, params);
}
/**
 * @description 创建会员
 * @param {Object} params -- 参数对象
 */
export function createMember (params: object) {
  return http.post(`${headUrl}/outside/membership/create`, params)
}

// 编辑会员
export function updateMember (params: object) {
  return http.post(`${headUrl}/outside/membership/update`, params)
}

// 查询会员详情
export function getMemberDetails (params: object) {
  return http.get(`${headUrl}/outside/membership/getMemberDetails`, params)
}

// 会员列表
export function memberList (params: object) {
  return http.post(`${headUrl}/outside/membership/search`, params)
}

// 删除会员
export function memberDelete (params: object) {
  return http.post(`${headUrl}/outside/membership/delete`, params)
}

// 会员授权查询
export function searchMemberShipAuthorization (params: object) {
  return http.get(`${headUrl}/outside/membership/searchMemberShipAuthorization`, params)
}

// 取消授权
export function deleteMemberShipAuthorization (params: object) {
  return http.get(`${headUrl}/outside/membership/deleteMemberShipAuthorization`, params)
}

// 添加会员授权
export function addMemberShipAuthorization (params: object) {
  return http.get(`${headUrl}/outside/membership/addMemberShipAuthorization`, params)
}

// 获取会员管理设置
export function getMemberConfig () {
  return http.get(`${headUrl}/outside/pc/memberConfig/get`)
}

// 会员详情-积分充值记录查询
export function searchPointsRecharge (params: object) {
  return http.post(`${headUrl}/outside/membership/searchPointsRecharge`, params)
}

// 会员详情-积分使用记录查询
export function searchPointsConsume (params: object) {
  return http.post(`${headUrl}/outside/membership/searchPointsConsume`, params)
}

// 会员详情-余额使用记录查询
export function searchBalanceConsume (params: object) {
  return http.post(`${headUrl}/outside/membership/searchBalanceConsume`, params)
}

// 会员详情-余额充值记录查询
export function searchBalanceRecharge (params: object) {
  return http.post(`${headUrl}/outside/membership/searchBalanceRecharge`, params)
}

// 会员详情-服务费充值记录查询
export function searchServiceFeeRecharge (params: object) {
  return http.post(`${headUrl}/outside/membership/searchServiceFeeRecharge`, params)
}
// 会员详情-服务费使用录查询
export function searchServiceFeeConsume (params: object) {
  return http.post(`${headUrl}/outside/membership/searchServiceFeeConsume`, params)
}

// 会员详情-额度使用记录查询
export function searchLimitConsume (params: object) {
  return http.post(`${headUrl}/outside/membership/searchLimitConsume`, params)
}
// 会员权益充值（积分、余额、额度、服务费等）
export function memberRecharge (params: object) {
  return http.post(`${headUrl}/outside/membership/recharge`, params)
}
// 积分服务费作废
export function memberObsolete (params: object) {
  return http.get(`${headUrl}/outside/membership/obsolete`, params)
}
// 获取客户下未被授权人
export function getLinkmanList (params: object) {
  return http.get(`/api/linkc/outside/linkc/v3b/member/getLinkmanList`, params)
}
// 会员动态信息查询
export function searchDynamicInformation (params: object) {
  return http.post(`${headUrl}/outside/membership/searchDynamicInformation`, params)
}
// 会员动态信息添加备注
export function addDynamic (params: object) {
  return http.post(`${headUrl}/outside/membership/addDynamic`, params)
}
// 会员动态信息添加备注
export function memberConsume (params: object) {
  return http.post(`${headUrl}/outside/membership/useMemberProperty`, params)
}

/**
 * @description 获取会员卡列表
 * @param {Object} params -- 参数对象
 */
export function getAllCardType(params: Record<string, never> | undefined) {
  return http.get(`/api/customer/outside/membership/card/getAllCardType`, params);
}

/**
 * @description 修改会员卡状态
 * @param {Object} params -- 参数对象
 */
export function editMembershipEnabled(params: Record<string, never> | undefined) {
  return http.post(`/api/customer/outside/membership/editMembershipEnabled`, params);
}
